package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author with葡萄成熟时
 * @version 1.0
 */
@RestController("userShopController")
@Api(tags = "店铺状态相关接口")
@Slf4j
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;


    /**
     * @description: 用户端获取店铺状态
     * @param:
     * @return:
     * @author Wait葡萄成熟时
     * @date: 下午12:46 2024/11/10
     */
    @GetMapping("/user/shop/status")
    @ApiOperation("用户端获取店铺状态")
    public Result<Integer> getShopStatus() {

        Integer status = (Integer) redisTemplate.opsForValue().get("SHOP_SRATUS");
        log.info("获取店铺状态:{}",status==1?"营业中":"打样中");
        return Result.success(status);

    }


}
